#include<stdlib.h>
int inc(const void*a,const void*b){
    return *(int*)(a)-*(int*)(b);
}
int main()
{

    int a[]={1,3,5,6,8,8,9,9,9,9,9,9,10,103};
    int key=8;
    /**
    void *bsearch(
         const void *key,
         const void *buf,
         size_t num,
         size_t size,
         int (*compare)(const void *, const void *) );
         */
    int *pos=bsearch(&key,
                     a,
                     sizeof(a)/sizeof(a[0]),
                     sizeof(a[0]),
                     inc);
    if(pos==NULL)
        puts("NOT FOUND");
    else
        printf("%d\n",pos-a);

    return 0;

}
